package com.skyline.jfs.cluster.service;

import java.util.TimerTask;

import org.springframework.beans.factory.annotation.Autowired;

import com.skyline.jfs.cluster.dao.JFSNodeDao;
import com.skyline.jfs.common.config.Config;

public class HearBeatService extends TimerTask {

	@Autowired
	private JFSNodeDao jfsNodeDao;

	@Autowired
	private LocalFSInfoSerivce localFSInfoSerivce;

	@Override
	public void run() {
		localFSInfoSerivce.initalLocalFSInfo();
		jfsNodeDao.updateHeartBeat();
		Config.setClusterNodes(jfsNodeDao.queryAllJFSNode());
		System.out.println("==========This is a heart beat sent from this node!===========");
	}

}